Numerical controller

ABSTRACT

A numerical controller includes an activation unit that builds a memory map according to settings when the power is on; a change detection unit that detects an operation requiring reconstructing of the memory map; a task control unit that, when the operation is detected, performs a stopping process of a task being operated; and a memory map control unit that, after the task has stopped, acquires a backed up memory, reconstructs the memory map according to the setting, and compares the reconstructed memory map and the backed-up memory map, and resets information required for operating the task again such as a program counter.

RELATED APPLICATION

The present application claims priority to Japanese Application Number2018-174185 filed Sep. 18, 2018, the disclosure of which is herebyincorporated by reference herein in its entirety.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a numerical controller, and moreparticularly to a numerical controller having a function of safelyreconstructing a memory map.

2. Description of the Related Art

At the time of power-on, most information processing apparatuses inwhich embedded software is installed determine a software configuration,a code area, sizes and addresses of a work area according to presetparameters and options. These memory locations are referred to as amemory map. It is designed to improve reliability and stability byfixing the memory map.

Similarly to the above information processing apparatuses, improvementof reliability and stability is improved by fixing the numericalcontroller that controls an industrial machine including a machine tool(hereinafter simply referred to as a machine) is achieved by fixing thememory map such as a code area and a work area. (see, for example,Japanese Patent Application Laid-Open No. 08-137513). In the method ofacquiring memory dynamically without fixing the memory map, for example,a lot of memory is secured by one function, and even if you an attemptis made to acquire the memory by another function, acquisition of memoryfails or the like depending on the state of the numerical controller,and consequently, unintended behavior may occur. In addition, when theoperation becomes unstable, the same result is not always obtained evenif the same processing program is operated, and the reproducibility isreduced.

However, when the memory map is fixed, it is necessary to restart thenumerical controller in order to reconstruct the memory map each timethe parameter or option setting is changed during the operation of thenumerical controller. For example, since the setting needs to be changedfrequently when the machine tool is started, the numerical controller isrepeatedly restarted, which places a burden on the operator.Furthermore, when restarting the numerical controller, it is alsonecessary to restart the peripheral devices connected to the numericalcontroller or the machine tool at the same time. At this time, it oftentakes much time for all peripheral devices to start up.

Currently, it is common to determine the memory map when the numericalcontroller is powered on, but in order to avoid the problems describedabove, it is sufficient to reflect changes in parameters and optionswithout restarting the numerical controller. In order to reconstruct thememory map during operation of the numerical controller, it is necessaryto stop the memory access of a CPU. If the memory map is reconstructedwithout stopping the memory access by the CPU, the program counter (FIG.4(a)) to which the CPU points immediately before the repartition becomesan abnormal value at the next moment (FIG. 4(b)), which may cause afailure.

It takes a considerable amount of time to stop the memory access of theCPU and perform the same processing as when the power is on duringoperation of the numerical controller. During that time, processing thatrequires a response in real time and responses to connected peripheraldevices cannot be performed at all (FIG. 5). If there is no responsefrom the numerical controller, for example, there is a possibility thatthe peripheral devices may view the numerical controller to have anabnormality or the like and stop the operation (FIG. 6).

SUMMARY OF THE INVENTION

The invention is intended to solve such problems, and it is an object toprovide a numerical controller having a function of safelyreconstructing a memory map.

A numerical controller according to an embodiment of the inventionincludes an activation unit that builds a memory map according tosettings when the numerical controller is powered on; a change detectionunit that detects an operation requiring reconstructing of the memorymap; a task control unit that, when the operation is detected, performsa stopping process of a task being operated; and a memory map controlunit that, after the task has stopped, acquires a backup of the memorymap, reconstructs the memory map according to the setting, and comparesthe reconstructed memory map and the backed-up memory map, and resetsinformation required for operating the task again such as a programcounter.

In the numerical controller according to an embodiment of the invention,the task control unit restarts the stopped task after the completion ofthe processing by the memory map control unit.

The numerical controller according to an embodiment of the inventionfurther includes a peripheral device communication unit that performscommunication with peripheral devices while the memory map control unitreconstructs the memory map, in which the communication is executed byarranging the backed-up memory map in a memory area different from amemory area of the memory map being reconstructed and further developinga program for executing the communication.

According to the invention, it is possible to provide a numericalcontroller having a function of safely reconstructing a memory map.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and features of the invention will beapparent from the following description of embodiments with reference tothe accompanying drawings. Of those figures:

FIG. 1 is a diagram illustrating an example of a hardware configurationof a numerical controller;

FIG. 2 is a diagram showing an example of a functional configuration ofthe numerical controller;

FIG. 3 is a flowchart showing an operation example of the numericalcontroller;

FIG. 4 is a diagram showing a problem in the related art;

FIG. 5 is a diagram showing a problem in the related art; and

FIG. 6 is a diagram showing a problem in the related art.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 is a schematic hardware configuration diagram showing a main partof the numerical controller 1 according to the first embodiment. Thenumerical controller 1 is a device that controls an industrial machineincluding a machine tool. The numerical controller 1 includes a CPU 11,a ROM 12, a RAM 13, a non-volatile memory 14, a bus 10, an axis controlcircuit 16, a servo amplifier 17, an interface 18, and an interface 19.A servomotor 50, an input/output device 60, and one or more peripheraldevices 70 are connected to the numerical controller 1.

The CPU 11 is a processor that controls the numerical controller 1 as awhole. The CPU 11 reads the system program stored in the ROM 12 via thebus 10, and controls the entire numerical controller 1 according to thesystem program.

The ROM 12 stores, for example, a system program for executing variouscontrols of the machine.

The RAM 13 temporarily stores temporary calculation data and displaydata, data and programs input by the operator via the input/outputdevice 60, and the like.

The non-volatile memory 14 is backed up by, for example, a battery, notshown, and retains the stored state even if the power of the numericalcontroller 1 is shut off. The non-volatile memory 14 stores data,programs, and the like input from the input/output device 60. Theprogram and data stored in the non-volatile memory 14 may be expanded onthe RAM 13 at the time of execution and use.

The axis control circuit 16 controls the operating axis of the machine.The axis control circuit 16 receives an axis movement command amountoutput from the CPU 11, and outputs an operation axis movement commandto the servo amplifier 17.

The servo amplifier 17 drives the servomotor 50 in response to an axismovement command output from the axis control circuit 16.

The servomotor 50 is driven by the servo amplifier 17 to move theoperating axis of the machine. The servomotor 50 typically incorporatesa position/speed detector. The position/speed detector outputs aposition/speed feedback signal, which is fed back to the axis controlcircuit 16 to perform position/speed feedback control.

Although only one axis control circuit 16, one servo amplifier 17, andone servomotor 50 are shown in FIG. 1, in actually, these are preparedby the same number as the number of axes to be controlled provided inthe machine.

The input/output device 60 is a data input/output device provided with adisplay, a hardware key and the like, and is typically an MDI or acontrol panel. The input/output device 60 displays the informationreceived from the CPU 11 via the interface 18 on the display. Theinput/output device 60 passes a command, data, etc. input from ahardware key or the like to the CPU 11 via the interface 18.

The peripheral device 70 is one or more peripheral devices connected tothe numerical controller or the machine tool, and includes, for example,various sensors, timers, robots, and the like. The peripheral device 70receives information from the CPU 11 via the interface 19. Informationoutput by the peripheral device 70 is passed to the CPU 11 via theinterface 19.

FIG. 2 is a block diagram showing a characteristic functionalconfiguration of the numerical controller 1. The typical numericalcontroller 1 includes an activation unit 101, a task control unit 102, achange detection unit 103, a peripheral device communication unit 104,and a memory map control unit 105. A combination of these is a componentenabled by the unique technology of the invention.

The operation of each processing unit of the numerical controller 1 willbe described in sequence with reference to the flowchart of FIG. 3. Theflowchart in FIG. 3 can be roughly classified into processing in a leftrectangle surrounded by the dashed dotted line and processing in a rightrectangle surrounded by the dashed dotted line. Among these, theprocessing in the rectangle on the right side particularly includes thenovel processing unique to the invention.

The activation unit 101 performs processing necessary when the numericalcontroller 1 is powered on (S101). For example, parameters and optionsstored in advance in the non-volatile memory 14 are read, software isloaded according to the settings, and a memory map of a code area and awork area is created. Furthermore, initialization of tasks andinitialization of communication between the CPU 11 and the peripheraldevices 70 are performed. After that, the activation unit 101 notifiesthe task control unit 102 of the completion of the processing to beexecuted at the time of power-on.

After the completion of the processing to be executed at the time ofpower-on, the task control unit 102 executes processing for activatingthe task (S102) or stopping the task according to the cycle and priorityof the task. To stop the task, make sure that the active task is notperforming critical processing and then stop it. If there is a task thatis performing critical processing, it is stopped after the processing ofthe task is completed (S104 to S105). When the operator performs anoperation requiring a restart (detected and notified by the changedetection unit 103 described later), the task control unit 102 notifiesthe memory map control unit 105 that all tasks have stopped, and thenasks to reconstruct the memory map.

The change detection unit 103 detects an operation by an operator thatneeds to be restarted (S103). An operation requiring a restart is anoperation requiring a reconstruct of the memory map, and includes, forexample, software installation. If an operation requiring restart isdetected, the change detection unit 103 requests the task control unit102 to stop all tasks in operation. When all tasks in operation stop,access to the memory area to be reconstructed by the CPU 11 is stopped,and safe reconstruction of the memory map is enabled.

While the memory map control unit 105 reconstructs the memory map, thatis, while the CPU 11 stops the memory access to the memory area beingreconstructed, the peripheral device communication unit 104 substitutescommunication (handshake) between the peripheral device 70 and thenumerical controller 1 (S106). For example, there are a process ofinvalidating a watchdog timer monitoring the state of the numericalcontroller 1 and a process of returning a response when a request orfeedback is transmitted from the servo motor to the numerical controller1. As a result, the peripheral device 70 can continue to operate whilethe numerical controller 1 is reconstructing the memory map withoutfalse recognition that the numerical controller 1 has stopped operatingor the like.

The peripheral device communication unit 104 can execute this processusing a memory area other than the memory area under reconstruction.That is, the peripheral device communication unit 104 secures atemporary memory map including a program and a work area for performinghandshake processing with the peripheral device 70 in an area differentfrom the memory map to be reconstructed. While the memory map controlunit 105 is reconstructing the memory map, the peripheral devicecommunication unit 104 performs handshake processing with the peripheraldevice 70 using the above-described temporary memory map.

The memory map control unit 105 controls the memory map. When requestedby the task control unit 102 to reconstruct the memory map, the memorymap control unit 105 acquires a backup of the memory map before startingreconstructing the memory map (S107). After that, the memory map controlunit 105 reads parameters and options again, executes known pre-checkprocessing (whether the memory map after reconstructing exceeds theusable memory size, etc.), and then loads software according to settingof the parameters and he options to reconstruct the memory map of thecode area and the work area (S108).

After reconstructing the memory map, the memory map control unit 105compares the backed up memory map with the reconstructed memory map, andthe information necessary for causing the task or the CPU 11 to operatethe task again such as an appropriate program counter are reset (S109).This makes it possible to operate the task safely. After that, thememory map control unit 105 requests the task control unit 102 to startthe task (S102).

According to the present embodiment, even when an operation thatrequires the restart of the numerical controller 1 in the related art,that is, an operation that requires reconstruction of the memory map isperformed, the memory map can be reconstructed while maintaining theconnection with the peripheral device 70 without requiring the restart.As a result, the time required for restarting the numerical controller 1(including the time required for restarting the peripheral devices, andthe like) can be reduced, so that the burden on the operator can bereduced. In addition, it is possible to reduce the power consumption andthe like accompanied with the restart.

Furthermore, according to the present embodiment, it is easy to attachand remove software and functions (such as dynamic download). Inaddition, since it is not necessary to restart the numerical controller1 when performing fault handling, debugging, and the like or whenupdating software, it is possible to realize a more flexible usage formthan in the related art.

As mentioned above, although the embodiment of the invention has beendescribed, the invention can be implemented in another aspect by addingan appropriate change without being limited to the example of embodimentmentioned above.

1. A numerical controller comprising: an activation unit that builds a memory map according to settings when the numerical controller is powered on; a change detection unit that detects an operation requiring reconstructing of the memory map; a task control unit that, when the operation is detected, performs a stopping process of a task being operated; and a memory map control unit that, after the task has stopped, acquires a backup of the memory map, reconstructs the memory map according to the setting, and compares the reconstructed memory map and the backed-up memory map, and resets information required for operating the task again such as a program counter.
 2. The numerical controller according to claim 1, wherein the task control unit restarts the stopped task after the completion of the processing by the memory map control unit.
 3. The numerical controller according to claim 1, further comprising a peripheral device communication unit that performs communication with a peripheral device while the memory map control unit reconstructs the memory map, wherein the communication is executed by arranging the backed-up memory map in a memory area different from a memory area of the memory map being reconstructed and further developing a program for executing the communication. 